package com.itheima.date;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Demo2 {
    public static void main(String[] args) throws ParseException {
        String birthday="1997-4-11";

        SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
        Date bir = sf.parse(birthday);

        long birTime = bir.getTime();

        long time = new Date().getTime();

        int day=(int)((time-birTime)/1000/3600/24/365);
        System.out.println(day);
    }
}
